Skip to content

Conversation

@WZhuo
Copy link
Contributor

@WZhuo WZhuo commented Dec 17, 2025

No description provided.

@WZhuo WZhuo marked this pull request as draft December 17, 2025 08:04
@WZhuo WZhuo force-pushed the create_table branch 2 times, most recently from b83be34 to 805973f Compare December 18, 2025 12:29
@WZhuo WZhuo force-pushed the create_table branch 3 times, most recently from a399aee to 9190a30 Compare December 25, 2025 09:28
int64_t next_row_id;

static Result<std::unique_ptr<TableMetadata>> Make(
const iceberg::Schema& schema, const iceberg::PartitionSpec& spec,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think we should rename functions below to GetSchema, GetSnapshot, etc. so we don't need to write iceberg:: prefix here and elsewhere?

Copy link
Contributor Author

@WZhuo WZhuo Dec 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Rename the function name like GetSchema.
  2. use class keyword replace of the namespace specified, like const class Schema& schema, const class PartitionSpec& spec.
    There's no need to write the namespace iceberg prefix other than TableMetadata's class scope. So I don't think rename function is well, we'll write GetSchema everywhere. I prefer solution 2.

}

// Reassign all column ids to ensure consistency
std::atomic<int32_t> last_column_id = 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to use atomic here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, It's convert from java, I think it's not really needed, fix it.

constexpr std::string_view kMetadataFolderName = "metadata";

// TableMetadata private static methods
Result<std::shared_ptr<PartitionSpec>> FreshPartitionSpec(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think FreshPartitionSpec and FreshSortOrder should also be called in the SetDefaultPartitionSpec and SetDefaultSortOrder, respectively.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unlike Java impl, I think no need to fresh field id in the TableMetadataBuilder::AddXXX.

@WZhuo WZhuo changed the title WIP feat: InMemoryCatalog create table feat: InMemoryCatalog::CreateTable & StageCreateTable api Dec 26, 2025
@WZhuo WZhuo marked this pull request as ready for review December 26, 2025 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants